
// pipeline.hpp
//

#ifndef _PIPELINE_HPP
#define _PIPELINE_HPP

#include "base.hpp"

#include "glm/gtc/type_ptr.hpp"



class RenderEngine;



// PipelineInfo
//
struct PipelineInfo
{
  std::string vertex_shader{};
  std::string fragment_shader{};
  GLenum polygon_mode{GL_LINE};
  bool textured{false};
  bool depth_test{false};
  bool normal_matrix{false};
};



// Pipeline
//
class Pipeline
{
public:
  Pipeline ( RenderEngine &engine,
             PipelineInfo info );

  void dump_program_infos ();
  
  bool is_textured () { return info.textured; }
  bool normal_matrix () { return info.normal_matrix; }
  
  void use ();
  
private:
  RenderEngine &engine;
  PipelineInfo info;

  wgl::Program program{};
  bool loaded{false};
  
  void load ();
  void check_components_layout ();
};



#endif
